package org.massi.imslp.query;

/**
 * Implementation for {@link ICredentials}: holds user name and password.
 */
public class CredentialsImpl implements ICredentials
{

	/**
	 * user name
	 */
	private final String username;
	/**
	 * password
	 */
	private final String password;


	/**
	 * Constructor with user name and password. They can be empty but not null
	 * 
	 * @param username user name: must not be null, may be empty
	 * @param password password: must not be null, may be empty
	 */
	public CredentialsImpl(final String username, final String password)
	{
		super();
		assert username != null;
		assert password != null;
		this.username = username;
		this.password = password;

	}


	/*
	 * (non-Javadoc)
	 * 
	 * @see org.massi.imslp.query.ICredentials#getUsername()
	 */
	@Override
	public String getUsername()
	{
		return this.username;
	}


	/*
	 * (non-Javadoc)
	 * 
	 * @see org.massi.imslp.query.ICredentials#getPassword()
	 */
	@Override
	public String getPassword()
	{
		return this.password;
	}


	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString()
	{
		return "CredentialsImpl [username=" + this.username + ", password=" + this.password + "]";
	}


}
